<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Text Style</title>
</head>

<body>
  <div>
    <p><code>
      transform: perspective(1px) translateZ(0);
    </code>迫使浏览器在css渲染时开启硬件加速
    </p>

    <p>
      <a class="text_shadow_rise" href="http://www.baidu.com" target="_blank">Baidu</a> is the most popular search
      engine of China.
    </p>

    <p>
      <a class="text_border_rise" href="http://www.baidu.com" target="_blank">Baidu</a> is the most popular search
      engine of China.
    </p>
  </div>

  <style>
    :root {
      --link-font-size: 32px;
      --link-color: #00a1d6;
      --transition-duration: 1s;
    }

    a,
    a:hover,
    a:link,
    a:visited {
      color: black;
      font-size: var(--link-font-size);
      text-decoration: none !important;
    }

    /* shadow rise */

    .text_shadow_rise {
      border-bottom: 1px solid var(--link-color);
      transition: box-shadow var(--transition-duration);
      transform: perspective(1px) translateZ(0);
    }

    .text_shadow_rise:hover {
      box-shadow: 0 -1em var(--link-color) inset;
    }

    /* border rise */

    .text_border_rise {
      position: relative;
      border-bottom: 1px solid var(--link-color);
    }

    .text_border_rise::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 100%;
      opacity: 0;
      border-bottom: 1px solid var(--link-color);
      transition: all var(--transition-duration);
      transform: perspective(1px) translateZ(0);
    }

    .text_border_rise:hover::after {
      top: -1em;
      opacity: 1;
    }

  </style>
</body>

</html>
